#ifndef DASHBOARD2_H
#define DASHBOARD2_H

#include <QWidget>
#include <QPaintEvent>
#include <QPainter>
#include <QPolygon>
#include <qmath.h>

class DashBoard2 : public QWidget
{
    Q_OBJECT
public:
    explicit DashBoard2(QWidget *parent = nullptr);
    void setEBSpeed(bool visible,float eb_speed);
    void setRecSpeed(bool visible,float rec_speed);
    void setRealTimeSpeed(float speed);
    void setStandByMode(bool set_mode);
signals:
protected:
    void paintEvent(QPaintEvent*);
    void drawOutCircle(QPainter *painter);
    void drawCenterCircle(QPainter *painter);
    void drawScale(QPainter *painter);
    void drawIndicator(QPainter *painter);
    void drawSpeedValue(QPainter *painter);
    void drawScaleNum(QPainter *painter);
    void drawYellowCursor(QPainter *painter);
    void drawRedCursor(QPainter *painter);
private:
    int max_speed_;
    int min_speed_;

    float start_angle_;
    float end_angle_;
    int scale_step_;
    int scale_cout_;
    float realtime_speed_;
    bool red_cursor_visible_=false;
    float eb_speed_red_;
    bool yellow_cursor_visible_=false;
    float rec_speed_yellow_;

    int total_angle_cofficient_;

    bool standby_mode_=false;
private:
    QColor out_circle_color_;
    QColor scale_color_;
    QColor scale_num_color_;
    QColor short_scale_color_;
    QColor center_circle_color_;
    QColor center_speed_color_;
    QColor indicatior_color_;
    QColor speed_unit_color_;
    QColor speed_color_;
};

#endif // DASHBOARD2_H
